
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
	$tank="";
	$arrayDatos = NULL;
	$desde = date('m-d-Y');
	$hasta = date('m-d-Y');
?>
<html lang="en">
  <head>
  		<title>Carroll Fuels</title>
  		<meta http-equiv="X-UA-Compatible" content="IE=edge">
  		<meta name="viewport" content="width=device-width, initial-scale=1.0">
  		<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
		<script type="text/javascript" src="js/jquery.ui.datepicker.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.10.3.custom.js"></script>
		<script type="text/javascript" src="js/bootstrap.min.js"></script>
		<script type="text/javascript" src="js/reports.js"></script>
		<script type="text/javascript" src="js/underscore.js"></script>
		<link href="css/ui-lightness/jquery-ui-1.10.3.custom.css" rel="stylesheet">
		<link href="css/bootstrap.min.css" rel="stylesheet">
		<link href="css/jumbotron-narrow.css" rel="stylesheet">
		<link href="css/normalize.css" rel="stylesheet">
		<link href="css/custom.css" rel="stylesheet">
	</head>
<body>
<div class="container">
	<div class="page-header">
      <h2>Carroll Fuels</h2>
    </div>
	<div class="row">
	  <div class="col-xs-6">
	    <h4>Add Daily Enviromental Data Entry</h4>
	  </div>
	  <div class="col-xs-3">
	   	<button class="btn btn-primary" data-backdrop="static" data-toggle="modal" data-target="#modal-edit" id='add-btn'>
		  Add
		</button>
	  </div>
	</div>
    <h3></h3>
    <h3>View report</h3>
	<form class="form-horizontal" role="form" id="report-form" method="POST" action="">
		<div class="row">
		  <div class="col-xs-3">
		    <h4>From:</h4>
		  </div>
		  <div class="col-xs-3">
		   <h4>To:</h4>
		  </div>
		</div>
		<div class="row">
		  <div class="col-xs-3">
		    <input type="text" class="form-control" id="from" name="from" value="<?php echo $desde;?>" size="15" />
		  </div>
		  <div class="col-xs-3">
		   <input type="text" class="form-control" id="to" name="to" value="<?php echo $hasta;?>" size="15" />
		  </div>
		</div>
		<div class="row">
		  <div class="col-xs-3">
		    <h4>Product:</h4>
		  </div>
		  <div class="col-xs-3">
		    <h4>User ID: <a id="open-modal-users" data-toggle="modal" href="#modal-users" title="Search user ID"><span class="glyphicon glyphicon-search"></a></span></h4>
		  </div>
		</div>
		<div class="row">
		  <div class="col-xs-3">
          	<select class="form-control" name='tank' id='tank'>
				<option value="CLR DSL" <?php if($tank=='CLR DSL'){echo "selected";}?>>CLR DSL</option>
				<option value="GASOLINE 87 OCT E-10 UNLEADED" <?php if($tank=='GASOLINE 87 OCT E-10 UNLEADED'){echo "selected";}?>>GASOLINE 87 OCT E-10 UNLEADED</option>
				<option value="GASOLINE 93 OCT E-10 HITEST" <?php if($tank=='GASOLINE 93 OCT E-10 HITEST'){echo "selected";}?>>GASOLINE 93 OCT E-10 HITEST</option>
			</select>
		  </div>
		  <div class="col-xs-3">
		   <input type="text" class="form-control" id="user-edit" name="user-edit" value=" " size="15" readonly />
		  </div>
		</div>
		<div class="row">
		  <div class="col-xs-3">
		    <h4>Action:</h4>
		  </div>
		</div>
		<div class="row">
		  <div class="col-md-4">
		    <button type="submit" class="btn btn-primary btn-block" value="Report" id="html-btn" dir="exporthtml.php">
		    	<span class="spinner"><i class="icon-spin icon-refresh"></i></span>Report in HTML
		    </button>
		  </div>
			  <div class="col-md-4">
		    <button type="submit" class="btn btn-primary btn-block" value="Export to PDF" id="pdf-btn" dir="exportpdf.php" disabled>Export to PDF</button>
		  </div>
		  <div class="col-md-4">
		    <button type="submit" class="btn btn-primary btn-block" value="Export to Excel" id="xls-btn" dir="exportexcel.php" disabled>Export to Excel</button>
		  </div>
		</div>
		<div class="row">
		  <div class="col-md-4">
		   	<button class="btn btn-primary btn-block" data-backdrop="static" data-toggle="modal" data-target="#modal-tanks" id='tanks-btn' >
			  Tank Setup
			</button>
		  </div>
		  <div class="col-md-4">
		   	<button class="btn btn-primary btn-block" data-backdrop="static" data-toggle="modal" data-target="#modal-inventory" id='inventory-btn' >
			  Dealer Inventory Setup
			</button>
		  </div>
		</div>
	  	<input type='hidden' name='html-data' id='html-data'>
	</form>
	<div id="data-response" class="jumbotrom"></div>
	
	<div class="modal fade" id="modal-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <h4 class="modal-title">Modify Daily Enviromental Data Entry</h4>
	      </div>
            <div class="modal-body">
				<form class="form-horizontal" role="form" id="edit-form" method="POST" action="">
					<div class="row">
					  <div class="col-xs-3">
					    <h5>ID:</h5>
					  </div>
					  <div class="col-xs-3">
					   <input type="text" class="form-control" id="id-edit" name="id-edit" value=" " size="15" readonly />
					  </div>
					  <div class="col-xs-3">
					    <h5>Date:</h5>
					  </div>
					  <div class="col-xs-3">
					   <input type="text" class="form-control" id="date-edit" name="date-edit" value="<?php echo $desde;?>" size="15" readonly />
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Product:</h5>
					  </div>
					  <div class="col-xs-3">
			          	<select class="form-control" name='product-edit' id='product-edit' />
			          		<option value="1C">1C</option>
			          		<option value="1D">1D</option>
			          		<option value="2">2</option>
			          		<option value="3D">3D</option>
			          		<option value="3DUL">3DUL</option>
			          		<option value="4C">4C</option>
			          		<option value="4U">4U</option>
			          		<option value="87C">87C</option>
			          		<option value="87E">87E</option>
			          		<option value="89E">89E</option>
			          		<option value="93C">93C</option>
			          		<option value="B2-4U">B2-4U</option>
			          		<option value="B2-4U">B2-4U</option>
			          		<option value="B5-4U">B5-4U</option>
						</select>
					  </div>
					  <div class="col-xs-3">
					    <h5>Opening Gallons:</h5>
					  </div>
					  <div class="col-xs-3">
					   <input type="text" class="form-control" id="gallons-edit" name="gallons-edit" value="" size="15" />
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Water:</h5>
					  </div>
					  <div class="col-xs-3">
					   <input type="text" class="form-control" id="water-edit" name="water-edit" value="" size="15" />
					  </div>
					  <div class="col-xs-3">
					    <h5>Sales:</h5>
					  </div>
					  <div class="col-xs-3">
					   <input type="text" class="form-control" id="sales-edit" name="sales-edit" value="" size="15" />
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Gross Deliveries:</h5>
					  </div>
					  <div class="col-xs-3">
					   <input type="text" class="form-control" id="gross-edit" name="gross-edit" value="" size="15" />
					  </div>
					  <div class="col-xs-3">
					    <h5>System Operating?</h5>
					  </div>
					  <div class="col-xs-3">
			         	<select class="form-control" name="so-edit" id="so-edit">
							<option value="yes">Yes</option>
							<option value="no">No</option>
						</select>
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>System in Alarm?</h5>
					  </div>
					  <div class="col-xs-3">
			         	<select class="form-control" name="sa-edit" id="sa-edit">
							<option value="yes">Yes</option>
							<option value="no">No</option>
						</select>
					  </div>
					  <div class="col-xs-3">
					    <h5>Hoses Ok?</h5>
					  </div>
					  <div class="col-xs-3">
			         	<select class="form-control" name="hoses-edit" id="hoses-edit">
							<option value="yes">Yes</option>
							<option value="no">No</option>
						</select>
					  </div>
					</div>

					<div class="row">
					  <div class="col-xs-3">
					    <h5>Nozzles Ok?</h5>
					  </div>
					  <div class="col-xs-3">
			         	<select class="form-control" name="nozzles-edit" id="nozzles-edit">
							<option value="yes">Yes</option>
							<option value="no">No</option>
						</select>
					  </div>
					  <div class="col-xs-3">
					    <h5>Dispensers Ok?</h5>
					  </div>
					  <div class="col-xs-3">
			         	<select class="form-control" name="dispensers-edit" id="dispensers-edit">
							<option value="yes">Yes</option>
							<option value="no">No</option>
						</select>
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Tank</h5>
					  </div>
					  <div class="col-xs-3">
			          	<select class="form-control" name='tank-edit' id='tank-edit' />
							<option value="CLR DSL">CLR DSL</option>
							<option value="GASOLINE 87 OCT E-10 UNLEADED" >GASOLINE 87 OCT E-10 UNLEADED</option>
							<option value="GASOLINE 93 OCT E-10 HITEST">GASOLINE 93 OCT E-10 HITEST</option>
						</select>
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Comments</h5>
					  </div>
					  <div class="col-xs-8">
					  	<textarea class="form-control" id="comments-edit" name="comments-edit">
						</textarea>
					  </div>
					</div>
				</form>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" id="close-edit" data-dismiss="modal">Close</button>
              <button type="button" class="btn btn-primary" id="save-edit">Save changes</button>
            </div>
          </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
  	</div>


	<div class="modal fade" id="modal-users" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <h4 class="modal-title">Select an user to display a report</h4>
	      </div>
            <div class="modal-body">
				<form class="form-horizontal" role="form" id="user-form" method="POST" action="">
					<div id="users-list" class="list-group" role="navigation">
						  <a href="#" data-id="1" class="list-group-item">Dapibus ac facilisis in</a>
						  <a href="#" data-id="2" class="list-group-item">Morbi leo risus</a>
						  <a href="#" data-id="3" class="list-group-item">Porta ac consectetur ac</a>
						  <a href="#" data-id="4" class="list-group-item">Vestibulum at eros</a>
					</div>
				</form>
            </div>
          </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
  	</div>

	<script type="text/html" id="tpl-users-list">
		<a href="#" data-id="<%= id %>" class="list-group-item active"><%= name %></a>
	</script>

	<div class="modal fade" id="modal-tanks" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <h4 class="modal-title" id="myModalLabel">Tanks setup</h4>
	      </div>
            <div class="modal-body">
				<form class="form-horizontal" role="form" id="tanks-form" method="POST" action="">
					<div class="row">
					  <div class="col-xs-6">
					    <p>ID has X tanks with X Capacity:</p>
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Tank ID:</h5>
					  </div>
					  <div class="col-xs-4">
					    <h5>Product:</h5>
					  </div>
					  <div class="col-xs-3">
					    <h5>Qty. of gallons:</h5>
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <input type="text" class="form-control" id="tanks-id-1" name="tanks-id-1" value="" size="15" />
					  </div>
					  <div class="col-xs-4">
			          	<select class="form-control" name='tanks-select-1' id='tanks-select-1' />
			          		<option value="1">Regular</option>
			          		<option value="2">Midgrade</option>
			          		<option value="3">Super</option>
			          		<option value="4">On Road Diesel</option>
			          		<option value="5">Off Road Diesel</option>
			          		<option value="6">Kerosene</option>
						</select>
					  </div>
					  <div class="col-xs-3">
					    <input type="text" class="form-control" id="tanks-gallons-1" name="tanks-gallons-1" value="" size="15" />
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <input type="text" class="form-control" id="tanks-id-2" name="tanks-id-2" value="" size="15" />
					  </div>
					  <div class="col-xs-4">
			          	<select class="form-control" name='tanks-select-2' id='tanks-select-2' />
			          		<option value="1">Regular</option>
			          		<option value="2">Midgrade</option>
			          		<option value="3">Super</option>
			          		<option value="4">On Road Diesel</option>
			          		<option value="5">Off Road Diesel</option>
			          		<option value="6">Kerosene</option>
						</select>
					  </div>
					  <div class="col-xs-3">
					    <input type="text" class="form-control" id="tanks-gallons-3" name="tanks-gallons-1" value="" size="15" />
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <input type="text" class="form-control" id="tanks-id-3" name="tanks-id-3" value="" size="15" />
					  </div>
					  <div class="col-xs-4">
			          	<select class="form-control" name='tanks-select-3' id='tanks-select-3' />
			          		<option value="1">Regular</option>
			          		<option value="2">Midgrade</option>
			          		<option value="3">Super</option>
			          		<option value="4">On Road Diesel</option>
			          		<option value="5">Off Road Diesel</option>
			          		<option value="6">Kerosene</option>
						</select>
					  </div>
					  <div class="col-xs-3">
					    <input type="text" class="form-control" id="tanks-gallons-3" name="tanks-gallons-3" value="" size="15" />
					  </div>
					</div>
				</form>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" id="close-tanks" data-dismiss="modal">Close</button>
              <button type="button" class="btn btn-primary" id="save-tanks">Save changes</button>
            </div>
          </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
  	</div>

	<div class="modal fade" id="modal-inventory" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-dialog">
	    <div class="modal-content">
	      <div class="modal-header">
	        <h4 class="modal-title" id="myModalLabel">Inventory Setup</h4>
	      </div>
            <div class="modal-body">
				<form class="form-horizontal" role="form" id="inventory-form" method="POST" action="">
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Tank ID:</h5>
					  </div>
					  <div class="col-xs-3">
					    <input type="text" class="form-control" id="inventory-tank-id" name="inventory-tank-id" value="" size="15" />
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Size:</h5>
					  </div>
					  <div class="col-xs-3">
					    <input type="text" class="form-control" id="inventory-tank-size" name="inventory-tank-size" value="" size="15" />
					  </div>
					</div>

					<div class="row">
					  <div class="col-xs-3">
					    <h5>Product:</h5>
					  </div>
					  <div class="col-xs-3">
			          	<select class="form-control" name='inventory-select' id='inventory-select' />
			          		<option value="1">Regular</option>
			          		<option value="2">Midgrade</option>
			          		<option value="3">Super</option>
			          		<option value="4">On Road Diesel</option>
			          		<option value="5">Off Road Diesel</option>
			          		<option value="6">Kerosene</option>
						</select>
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Blender:</h5>
					  </div>
					  <div class="col-xs-3">
						<div class="btn-group" data-toggle="buttons-radio">
							<input type="radio" name="inventory-blender" value="1" checked>Yes
							<input type="radio" name="inventory-blender" value="0">No						    
						</div>
					  </div>
					  <div class="col-xs-3">
			          	<select class="form-control" name='inventory-blender-type' id='inventory-blender-type' />
			          		<option value="1">Sunoco</option>
			          		<option value="2">Standard</option>
						</select>
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Manifold:</h5>
					  </div>
					  <div class="col-xs-3">
						<div class="btn-group" data-toggle="buttons-radio">
							<input type="radio" name="inventory-manifold" value="1" checked>Yes
							<input type="radio" name="inventory-manifold" value="0">No						    
						</div>
					  </div>
					  <div class="col-xs-3">
					    <h5>Tank No:</h5>
					  </div>
					  <div class="col-xs-3">
			          	<input type="text" class="form-control" id="inventory-tank-no" name="inventory-tank-no" value="" size="15" />
					  </div>
					</div>
					<div class="row">
					  <div class="col-xs-3">
					    <h5>Carroll Notificacions:</h5>
					  </div>
					  <div class="col-xs-3">
						<div class="btn-group" data-toggle="buttons-radio">
							<input type="radio" name="inventory-notifications" value="1" checked>Yes
							<input type="radio" name="inventory-notifications" value="0">No						    
						</div>
					  </div>
					</div>
				</form>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" id="close-tanks" data-dismiss="modal">Close</button>
              <button type="button" class="btn btn-primary" id="save-inventory">Save changes</button>
            </div>
          </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
  	</div>



</div>

</body>
</html>
